package javacafe.serviceimple;

import java.util.List;

import javacafe.dao.BbsDAO;
import javacafe.daoimpl.BbsDAOImple;
import javacafe.dto.bbs.BbsDTO;
import javacafe.service.BbsService;


public class BbsServiceImple implements BbsService {
	
	private BbsDAO bbsDAO;
	private static BbsServiceImple bbsService;
	
	private BbsServiceImple() {		
		bbsDAO = new BbsDAOImple();
	}
	
	public static BbsServiceImple getInstance(){
		if (bbsService==null) {
			bbsService=new BbsServiceImple();
		}
		return bbsService;
	}

	public void setBbsDAO(BbsDAO bbsDAO) {
		this.bbsDAO = bbsDAO;
	}
	
	@Override
	public List getBbs(BbsDTO dto) {		
		return bbsDAO.getBbs(dto);
	}
		
	@Override
	public boolean insertBbs(BbsDTO dto) {
		return bbsDAO.insertBbs(dto);
	}

	@Override
	public List getAllBbs() {
		return bbsDAO.getAllBbs();
	}

	
}
